<template>
  <div>
    <van-nav-bar
        left-arrow
        @click-left="$router.go(-1)"
        :title="this.$route.meta.title"
        right-text
      >
        <template #right v-if="this.$route.meta.a">删除</template>
      </van-nav-bar>
    <van-address-list
      v-model="chosenAddressId"
      :list="list"
      default-tag-text="默认"
      @add="onAdd"
      @edit="onEdit"
      add-button-text="添加新收货人"
    />
  </div>
</template>

<script>
// import { Toast } from "vant";
export default {
  name: "WorkspaceJsonDetail",

  data() {
    return {
      chosenAddressId: 1,
      list: [
        {
          id: "1",
          name: "张三",
          tel: "13000000000",
          address: "浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室",
          isDefault: true,
        },
        {
          id: "2",
          name: "张三",
          tel: "13000000000",
          address: "浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室",
          isDefault: false,
        },
        {
          id: "3",
          name: "张三",
          tel: "13000000000",
          address: "浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室",
          isDefault: false,
        },
        {
          id: "4",
          name: "张三",
          tel: "13000000000",
          address: "浙江省杭州市西湖区文三路 138 号东方通信大厦 7 楼 501 室",
          isDefault: false,
        },
      ],
    };
  },

  mounted() {},

  methods: {
    addlist() {
      this.$router.push("/detail");
    },
    onAdd() {
      //   Toast("添加新收货人");
      this.$router.push("/adds");
    },
    onEdit(item, index) {
      this.$router.push("/edits");
    },
  },
};
</script>

<style lang="less" scoped>
.van-button {
  background: #1abc9c;
  border: none;
  width: 60%;
  margin-left: 65px;
}
.van-tag {
  background: white;
  color: wheat;
  border: 2px solid wheat;
}
</style>